import { createRouter, createWebHashHistory } from "vue-router";
const routes = [
  {
    path: "/",
    hidden: "true",
    redirect: "/login",
    component: () => import("@/components/Login"),
  },
  {
    path: "/register",
    name: "Register",
    hidden: true,
    component: () => import("@/components/Register"),
  },
  {
    path: "/login",
    name: "Login",
    hidden: true,
    component: () => import("@/components/Login"),
  },
  {
    path: "/home",
    name: "学生管理",
    redirect: "/home/count",
    meta: {
      isAuth: true,
    },
    component: () => import("@/components/Home"),
    children: [
      {
        path: "/home/upload",
        name: "添加学生",
        iconClass: "fa fa-list",
        meta: {
          isAuth: true,
        },
        component: () => import("@/components/students/Upload"),
      },
      {
        path: "/home/count",
        name: "学生人数",
        iconClass: "fa fa-list",
        meta: {
          isAuth: true,
        },
        component: () => import("@/components/students/HomeCount"),
      },
      {
        path: "/home/student",
        name: "学生列表",
        iconClass: "fa fa-list",
        meta: {
          isAuth: true,
        },
        component: () => import("@/components/students/StudentList"),
      },

      
      {
        path: "/home/familyInfo/UploadFamily",
        name: "批量添加家庭信息数据",
        iconClass: "fa fa-list-alt",
        meta: {
          isAuth: true,
        },
        component: () => import("@/components/students/familyInfo/UploadFamily"),
      },
      {
        path: "/home/familyInfo",
        name: "家庭信息",
        iconClass: "fa fa-list-alt",
        meta: {
          isAuth: true,
        },
        component: () => import("@/components/students/familyInfo/Main.vue"),
      },
      {
        path: "/home/graduateion",
        name: "毕业信息",
        iconClass: "fa fa-list",
        meta: {
          isAuth: true,
        },
        component: () => import("@/components/students/GraduateInfo"),
      },
    ],
  },
  {
    path: "/home",
    name: "课程管理",
    // redirect: '/home/course',
    meta: {
      isAuth: true,
    },
    // component: () => import('@/components/students/CourseList'),
    component: () => import("@/components/Home"),
    children: [
      {
        path: "/home/course",
        name: "全部课程",
        iconClass: "fa fa-list-ul",
        meta: {
          isAuth: true,
        },
        component: () => import("../components/students/course/courseMain.vue"),
      },
    ],
  },
  {
    path: "/home",
    name: "数据分析",
    iconClass: "fa fa-bar-chart",
    meta: {
      isAuth: true,
    },
    component: () => import("@/components/Home"),
    children: [
      {
        path: "/home/graduate",
        name: "毕业生信息",
        hidden: true,
        iconClass: "fa fa-line-chart",
        component: () => import("@/components/dataAnalysis/GraduateList"),
      },
      {
        path: "/home/dataview",
        name: "数据概览",
        iconClass: "fa fa-line-chart",
        meta: {
          isAuth: true,
        },
        component: () => import("@/components/dataAnalysis/DataView2"),
      },
      {
        path: "/home/mapview",
        name: "地图概览",
        iconClass: "fa fa-line-chart",
        meta: {
          isAuth: true,
        },
        component: () => import("@/components/dataAnalysis/MapView2"),
      },
      {
        path: "/home/workmap",
        name: "工作地图",
        iconClass: "fa fa-line-chart",
        meta: {
          isAuth: true,
        },
        component: () => import("@/components/dataAnalysis/WorkMap2"),
      },
      {
        path: "/city/:cityname",
        name: "城市地图",
        hidden: true,
        iconClass: "fa fa-line-chart",
        component: () => import("@/components/dataAnalysis/CityMap"),
        children: [
          {
            path: "/city/:cityname/:cityname2",
            name: "城市就业信息", // hidden:true,
            iconClass: "fa fa-line-chart",
            component: () => import("@/components/dataAnalysis/Info"),
          },
        ],
      },
    ],
  },
  {
    path: "/home",
    name: "学生课程管理",
    iconClass: "fa fa-bar-chart",
    component: () => import("@/components/Home"),
    children: [
      {
        path: "/home/courseinfo",
        name: "选课课程信息",
        iconClass: "fa fa-line-chart",
        component: () => import("@/components/Scourse/Courseinfo"),
      },
      {
        path: "/home/usestucourse/:name", //使用占位符声明接受params参数
        name: "选课信息",
        hidden: true,
        iconClass: "fa fa-line-chart",
        component: () => import("@/components/Scourse/Stucourseinfo"),
      },
    ],
  },
  {
    path: "/users",
    name: "用户中心",
    iconClass: "user",
    meta: {
      isAuth: true,
    },
    redirect: "/users/user",
    component: () => import("@/components/Home"),
    children: [
      {
        path: "/users/user",
        name: "个人信息",
        iconClass: "fa fa-user",
        meta: {
          isAuth: true,
        },
        component: () => import("@/components/personInfo/PersonInfo.vue"),
      },
    ],
  },
];
const router = createRouter({
  history: createWebHashHistory(), //hash
  routes,
});

export default router;
